﻿using System;

namespace Models
{
    public class DataPage
    {
        private int _pageSize = 20;
        public int PageSize
        {
            get
            {
                return _pageSize;
            }
            set
            {
                _pageSize = value;
            }
        }
        private int _pageIndex = 1;
        public int PageIndex
        {
            get
            {
                return _pageIndex;
            }
            set
            {
                _pageIndex = value;
            }
        }
        private int _dataCount = 0;
        public int DataCount
        {
            get
            {
                return _dataCount;
            }
            set
            {
                _dataCount = value;
            }
        }
        public int PageCount => (int)Math.Ceiling(Convert.ToDecimal(DataCount / PageSize));
    }
}
